package cn.stylefeng.guns.modular.business.frequency.transportsignimage.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.business.frequency.transportsignimage.service.TransportSignImageService;
import cn.stylefeng.guns.modular.business.frequency.transportsignimage.model.param.TransportSignImageParam;

import javax.annotation.Resource;

/**
 * 运单签收图片 控制器
 *
 * @author: yujie
 * @date: 2023/05/09 17:15
 */
@RestController
public class TransportSignImageController {

    @Resource
    private TransportSignImageService transportSignImageService;

    /**
     * 分页查询运单签收图片
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @GetMapping("/transportSignImage/page")
    @BusinessLog(title = "运单签收图片_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(TransportSignImageParam transportSignImageParam) {
        return new SuccessResponseData(transportSignImageService.page(transportSignImageParam));
    }

    /**
     * 获取全部运单签收图片
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @GetMapping("/transportSignImage/list")
    @BusinessLog(title = "运单签收图片_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(TransportSignImageParam transportSignImageParam) {
        return new SuccessResponseData(transportSignImageService.list(transportSignImageParam));
    }

    /**
     * 查看详情运单签收图片
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @GetMapping("/transportSignImage/detail")
    @BusinessLog(title = "运单签收图片_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(TransportSignImageParam.detail.class) TransportSignImageParam transportSignImageParam) {
        return new SuccessResponseData(transportSignImageService.detail(transportSignImageParam));
    }

    /**
     * 添加运单签收图片
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @PostMapping("/transportSignImage/add")
    @BusinessLog(title = "运单签收图片_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(TransportSignImageParam.add.class) TransportSignImageParam transportSignImageParam) {
        transportSignImageService.add(transportSignImageParam);
        return new SuccessResponseData();
    }

    /**
     * 删除运单签收图片
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @PostMapping("/transportSignImage/delete")
    @BusinessLog(title = "运单签收图片_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(TransportSignImageParam.delete.class) TransportSignImageParam transportSignImageParam) {
        transportSignImageService.delete(transportSignImageParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑运单签收图片
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @PostMapping("/transportSignImage/edit")
    @BusinessLog(title = "运单签收图片_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(TransportSignImageParam.edit.class) TransportSignImageParam transportSignImageParam) {
        transportSignImageService.edit(transportSignImageParam);
        return new SuccessResponseData();
    }


}
